import uuid
from components.models import DeployEvent, DownloadEvent
import logging
logger = logging.getLogger('django')

def deploy_event_in(deploy_event_ids, info, deploy_event_status):
    logger.info(info)
    obj = DeployEvent(deploy_event_id=str(uuid.uuid1()),deploy_event_ids=deploy_event_ids, deploy_event_info=info, deploy_event_status=deploy_event_status)
    obj.save()


def download_event_in(deploy_event_ids, info, deploy_event_status, download_enent_step_code='', download_event_type='normal_info'):
    logger.info(info)
    obj = DownloadEvent(download_event_id=str(uuid.uuid1()),
                        download_event_ids=deploy_event_ids,
                        download_event_info=info,
                        download_event_status=deploy_event_status,
                        download_enent_step_code=download_enent_step_code,
                        download_event_type=download_event_type)
    obj.save()